<!DOCTYPE html>
<html lang=en>
<head>
    <!-- so meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="HandheldFriendly" content="True">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="description" content="1、使用FluentAPI1.1、在OnModelCreating方法下使用public class FluentApiDb:DbContext { public DbSet Courses { get; set; } protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Entity">
<meta property="og:type" content="article">
<meta property="og:title" content="使用FluentAPI(EntityFramework)">
<meta property="og:url" content="http://yoursite.com/2018/06/17/%E4%BD%BF%E7%94%A8FluentAPI(EntityFramework)/index.html">
<meta property="og:site_name" content="TmoonSite">
<meta property="og:description" content="1、使用FluentAPI1.1、在OnModelCreating方法下使用public class FluentApiDb:DbContext { public DbSet Courses { get; set; } protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Entity">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2018-06-16T18:49:18.000Z">
<meta property="article:modified_time" content="2020-01-07T10:48:14.797Z">
<meta property="article:author" content="Tmoonlight">
<meta name="twitter:card" content="summary">
    
    
        
          
              <link rel="shortcut icon" href="/images/favicon.ico">
          
        
        
          
            <link rel="icon" type="image/png" href="/images/logo2.gif" sizes="192x192">
          
        
        
          
            <link rel="apple-touch-icon" sizes="180x180" href="/images/logo2.gif">
          
        
    
    <!-- title -->
    <title>使用FluentAPI(EntityFramework)</title>
    <!-- styles -->
    
<link rel="stylesheet" href="/css/style.css">

    <!-- persian styles -->
    
      
<link rel="stylesheet" href="/css/rtl.css">

    
    <!-- rss -->
    
    
<meta name="generator" content="Hexo 4.2.0"></head>

<body class="max-width mx-auto px3 ltr">
    
      <div id="header-post">
  <a id="menu-icon" href="#"><i class="fas fa-bars fa-lg"></i></a>
  <a id="menu-icon-tablet" href="#"><i class="fas fa-bars fa-lg"></i></a>
  <a id="top-icon-tablet" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');" style="display:none;"><i class="fas fa-chevron-up fa-lg"></i></a>
  <span id="menu">
    <span id="nav">
      <ul>
         
          <li><a href="/">Home</a></li>
         
          <li><a href="/about/">About</a></li>
         
          <li><a href="/archives/">Writing</a></li>
         
          <li><a href="/projects_url">Projects</a></li>
        
      </ul>
    </span>
    <br/>
    <span id="actions">
      <ul>
        
        <li><a class="icon" href="/2018/06/26/%E5%AF%B9webapi%E4%B8%AD%E5%BC%82%E6%AD%A5%E6%96%B9%E6%B3%95%E5%A5%BD%E5%A4%84%E7%9A%84%E8%A7%A3%E9%87%8A%EF%BC%8C%E6%AF%94%E8%BE%83%E5%85%A8%E9%9D%A2/"><i class="fas fa-chevron-left" aria-hidden="true" onmouseover="$('#i-prev').toggle();" onmouseout="$('#i-prev').toggle();"></i></a></li>
        
        
        <li><a class="icon" href="/2018/06/03/%E5%8D%81%E5%A4%A7%E7%BB%8F%E5%85%B8%E6%8E%92%E5%BA%8F%E7%AE%97%E6%B3%95%EF%BC%88%E5%8A%A8%E5%9B%BE%E6%BC%94%E7%A4%BA%EF%BC%89-%E4%B8%80%E5%83%8F%E7%B4%A0-%E5%8D%9A%E5%AE%A2%E5%9B%AD/"><i class="fas fa-chevron-right" aria-hidden="true" onmouseover="$('#i-next').toggle();" onmouseout="$('#i-next').toggle();"></i></a></li>
        
        <li><a class="icon" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');"><i class="fas fa-chevron-up" aria-hidden="true" onmouseover="$('#i-top').toggle();" onmouseout="$('#i-top').toggle();"></i></a></li>
        <li><a class="icon" href="#"><i class="fas fa-share-alt" aria-hidden="true" onmouseover="$('#i-share').toggle();" onmouseout="$('#i-share').toggle();" onclick="$('#share').toggle();return false;"></i></a></li>
      </ul>
      <span id="i-prev" class="info" style="display:none;">Previous post</span>
      <span id="i-next" class="info" style="display:none;">Next post</span>
      <span id="i-top" class="info" style="display:none;">Back to top</span>
      <span id="i-share" class="info" style="display:none;">Share post</span>
    </span>
    <br/>
    <div id="share" style="display: none">
      <ul>
  <li><a class="icon" href="http://www.facebook.com/sharer.php?u=http://yoursite.com/2018/06/17/%E4%BD%BF%E7%94%A8FluentAPI(EntityFramework)/" target="_blank" rel="noopener"><i class="fab fa-facebook " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://twitter.com/share?url=http://yoursite.com/2018/06/17/%E4%BD%BF%E7%94%A8FluentAPI(EntityFramework)/&text=使用FluentAPI(EntityFramework)" target="_blank" rel="noopener"><i class="fab fa-twitter " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.linkedin.com/shareArticle?url=http://yoursite.com/2018/06/17/%E4%BD%BF%E7%94%A8FluentAPI(EntityFramework)/&title=使用FluentAPI(EntityFramework)" target="_blank" rel="noopener"><i class="fab fa-linkedin " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://pinterest.com/pin/create/bookmarklet/?url=http://yoursite.com/2018/06/17/%E4%BD%BF%E7%94%A8FluentAPI(EntityFramework)/&is_video=false&description=使用FluentAPI(EntityFramework)" target="_blank" rel="noopener"><i class="fab fa-pinterest " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="mailto:?subject=使用FluentAPI(EntityFramework)&body=Check out this article: http://yoursite.com/2018/06/17/%E4%BD%BF%E7%94%A8FluentAPI(EntityFramework)/"><i class="fas fa-envelope " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://getpocket.com/save?url=http://yoursite.com/2018/06/17/%E4%BD%BF%E7%94%A8FluentAPI(EntityFramework)/&title=使用FluentAPI(EntityFramework)" target="_blank" rel="noopener"><i class="fab fa-get-pocket " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://reddit.com/submit?url=http://yoursite.com/2018/06/17/%E4%BD%BF%E7%94%A8FluentAPI(EntityFramework)/&title=使用FluentAPI(EntityFramework)" target="_blank" rel="noopener"><i class="fab fa-reddit " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.stumbleupon.com/submit?url=http://yoursite.com/2018/06/17/%E4%BD%BF%E7%94%A8FluentAPI(EntityFramework)/&title=使用FluentAPI(EntityFramework)" target="_blank" rel="noopener"><i class="fab fa-stumbleupon " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://digg.com/submit?url=http://yoursite.com/2018/06/17/%E4%BD%BF%E7%94%A8FluentAPI(EntityFramework)/&title=使用FluentAPI(EntityFramework)" target="_blank" rel="noopener"><i class="fab fa-digg " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.tumblr.com/share/link?url=http://yoursite.com/2018/06/17/%E4%BD%BF%E7%94%A8FluentAPI(EntityFramework)/&name=使用FluentAPI(EntityFramework)&description=" target="_blank" rel="noopener"><i class="fab fa-tumblr " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://news.ycombinator.com/submitlink?u=http://yoursite.com/2018/06/17/%E4%BD%BF%E7%94%A8FluentAPI(EntityFramework)/&t=使用FluentAPI(EntityFramework)" target="_blank" rel="noopener"><i class="fab fa-hacker-news " aria-hidden="true"></i></a></li>
</ul>

    </div>
    <div id="toc">
      <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#1、使用FluentAPI"><span class="toc-number">1.</span> <span class="toc-text">1、使用FluentAPI</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-1、在OnModelCreating方法下使用"><span class="toc-number">1.1.</span> <span class="toc-text">1.1、在OnModelCreating方法下使用</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#1-1、新增一个类，在OnModelCreating中引用"><span class="toc-number">1.2.</span> <span class="toc-text">1.1、新增一个类，在OnModelCreating中引用</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2、FluentAPI详细用法"><span class="toc-number">2.</span> <span class="toc-text">2、FluentAPI详细用法</span></a></li></ol>
    </div>
  </span>
</div>

    
    <div class="content index py4">
        
        <article class="post" itemscope itemtype="http://schema.org/BlogPosting">
  <header>
    
    <h1 class="posttitle" itemprop="name headline">
        使用FluentAPI(EntityFramework)
    </h1>



    <div class="meta">
      <span class="author" itemprop="author" itemscope itemtype="http://schema.org/Person">
        <span itemprop="name">TmoonSite</span>
      </span>
      
    <div class="postdate">
      
        <time datetime="2018-06-16T18:49:18.000Z" itemprop="datePublished">2018-06-17</time>
        
      
    </div>


      

      

    </div>
  </header>
  

  <div class="content" itemprop="articleBody">
    <h2 id="1、使用FluentAPI"><a href="#1、使用FluentAPI" class="headerlink" title="1、使用FluentAPI"></a>1、使用FluentAPI</h2><h3 id="1-1、在OnModelCreating方法下使用"><a href="#1-1、在OnModelCreating方法下使用" class="headerlink" title="1.1、在OnModelCreating方法下使用"></a>1.1、在OnModelCreating方法下使用</h3><p>public class FluentApiDb:DbContext</p>
<p>{</p>
<p>public DbSet<Course> Courses { get; set; }</p>
<p>protected override void OnModelCreating(DbModelBuilder modelBuilder)</p>
<p>{</p>
<p>modelBuilder.Entity<Course>().Property(o =&gt; o.Title).HasMaxLength(20);</p>
<p>}</p>
<p>}</p>
<h3 id="1-1、新增一个类，在OnModelCreating中引用"><a href="#1-1、新增一个类，在OnModelCreating中引用" class="headerlink" title="1.1、新增一个类，在OnModelCreating中引用"></a>1.1、新增一个类，在OnModelCreating中引用</h3><p>public class FluentApiDb:DbContext</p>
<p>{</p>
<p>public DbSet<Teacher> Teacher { get; set; }</p>
<p>protected override void OnModelCreating(DbModelBuilder modelBuilder)</p>
<p>{</p>
<p>modelBuilder.Configurations.Add(new TeacherMap());</p>
<p>modelBuilder.Configurations.Add(new StudentMap());</p>
<p>base.OnModelCreating(modelBuilder);</p>
<p>}</p>
<p>}</p>
<p>通过反射动态加入。利：自动加入，无需人工反复加；弊：影响性能。</p>
<p>public class FluentApiDb:DbContext</p>
<p>{</p>
<p>public DbSet<Teacher> Teacher { get; set; }</p>
<p>protected override void OnModelCreating(DbModelBuilder modelBuilder)</p>
<p>{</p>
<p>var typesToRegister = Assembly.GetExecutingAssembly().GetTypes()</p>
<p>.Where(type =&gt; !String.IsNullOrEmpty(type.Namespace))</p>
<p>.Where(type =&gt; type.BaseType != null &amp;&amp; type.BaseType.IsGenericType</p>
<p>&amp;&amp; type.BaseType.GetGenericTypeDefinition() == typeof(EntityTypeConfiguration&lt;&gt;));</p>
<p>foreach (var type in typesToRegister)</p>
<p>{</p>
<p>dynamic configurationInstance = Activator.CreateInstance(type);</p>
<p>modelBuilder.Configurations.Add(configurationInstance);</p>
<p>}</p>
<p>base.OnModelCreating(modelBuilder);</p>
<p>}</p>
<p>}</p>
<h2 id="2、FluentAPI详细用法"><a href="#2、FluentAPI详细用法" class="headerlink" title="2、FluentAPI详细用法"></a>2、FluentAPI详细用法</h2><ul>
<li>设置主键</li>
</ul>
<p>modelBuilder.Entity<x>().HasKey(t =&gt; t.Name);</p>
<ul>
<li>设置联合主键</li>
</ul>
<p>modelBuilder.Entity<x>().HasKey(t =&gt;new{t.Name,t.ID} );</p>
<ul>
<li>取消数据库字段标识（取消自动增长）</li>
</ul>
<p>modelBuilder.Entity<x>().Property(t=&gt;t.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);</p>
<ul>
<li>设置数据库字段标识（自动增长）</li>
</ul>
<p>modelBuilder.Entity<Teacher>().Property(t =&gt;t.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);</p>
<ul>
<li>设置字段最大长度</li>
</ul>
<p>modelBuilder.Entity<ClassA>().Property(t =&gt; t.Name).HasMaxLength(100);</p>
<ul>
<li>设置字段为必需</li>
</ul>
<p>modelBuilder.Entity<ClassA>().Property(t =&gt;t.Id).IsRequired();</p>
<ul>
<li>属性不映射到数据库</li>
</ul>
<p>modelBuilder.Entity<ClassA>().Ignore(t =&gt; t.A);</p>
<ul>
<li>将属性指定数据库列名：</li>
</ul>
<p>modelBuilder.Entity<ClassA>() .Property(t =&gt; t.A) .HasColumnName(“A_a”);</p>
<ul>
<li>级联删除（数据库默认是不级联删除的）</li>
</ul>
<p>modelBuilder.Entity<Course>().HasRequired(t =&gt; t.Department).WithMany(t =&gt; t.Courses).HasForeignKey(d =&gt; d.DepartmentID).WillCascadeOnDelete();</p>
<ul>
<li>设置为Timestamp</li>
</ul>
<p>modelBuilder.Entity<OfficeAssignment>() .Property(t =&gt; t.Timestamp) .IsRowVersion();</p>
<ul>
<li>表1对0..1(Instructor实体可以包含零个或一个OfficeAssignment)</li>
</ul>
<p>modelBuilder.Entity<OfficeAssignment>().HasRequired(t =&gt; t.Instructor).WithOptional(t =&gt; t.OfficeAssignment);</p>
<ul>
<li>表1对1</li>
</ul>
<p>modelBuilder.Entity<Instructor>().HasRequired(t =&gt; t.OfficeAssignment).WithRequiredPrincipal(t =&gt; t.Instructor);</p>
<ul>
<li>表1对n（Department为主表）</li>
</ul>
<p>modelBuilder.Entity<Staff>() .HasRequired(c =&gt; c.Department) .WithMany(t =&gt; t.Staffs)</p>
<ul>
<li>指定外键名（指定表Staff中的字段DepartmentID为外键）</li>
</ul>
<p>modelBuilder.Entity<Staff>() .HasRequired(c =&gt; c.Department) .WithMany(t =&gt; t.Staffs) .Map(m =&gt; m.MapKey(“DepartmentID”));</p>
<ul>
<li>表n对n</li>
</ul>
<p>modelBuilder.Entity<Course>()</p>
<p>.HasMany(t =&gt; t.Instructors)</p>
<p>.WithMany(t =&gt; t.Courses)</p>
<ul>
<li>表n对n指定连接表名及列名</li>
</ul>
<p>modelBuilder.Entity<Course>()</p>
<p>.HasMany(t =&gt; t.Instructors)</p>
<p>.WithMany(t =&gt; t.Courses)</p>
<p>.Map(m =&gt;</p>
<p>{</p>
<p>m.ToTable(“CourseInstructor”);</p>
<p>m.MapLeftKey(“CourseID”);</p>
<p>m.MapRightKey(“InstructorID”);</p>
<p>});</p>
<p>作者：落地成佛</p>
<p>链接：<a href="https://www.jianshu.com/p/c82ef6babf8e" target="_blank" rel="noopener">https://www.jianshu.com/p/c82ef6babf8e</a></p>
<p>來源：简书</p>
<p>简书著作权归作者所有，任何形式的转载都请联系作者获得授权并注明出处。</p>

  </div>
</article>



        
          <div id="footer-post-container">
  <div id="footer-post">

    <div id="nav-footer" style="display: none">
      <ul>
         
          <li><a href="/">Home</a></li>
         
          <li><a href="/about/">About</a></li>
         
          <li><a href="/archives/">Writing</a></li>
         
          <li><a href="/projects_url">Projects</a></li>
        
      </ul>
    </div>

    <div id="toc-footer" style="display: none">
      <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#1、使用FluentAPI"><span class="toc-number">1.</span> <span class="toc-text">1、使用FluentAPI</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-1、在OnModelCreating方法下使用"><span class="toc-number">1.1.</span> <span class="toc-text">1.1、在OnModelCreating方法下使用</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#1-1、新增一个类，在OnModelCreating中引用"><span class="toc-number">1.2.</span> <span class="toc-text">1.1、新增一个类，在OnModelCreating中引用</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2、FluentAPI详细用法"><span class="toc-number">2.</span> <span class="toc-text">2、FluentAPI详细用法</span></a></li></ol>
    </div>

    <div id="share-footer" style="display: none">
      <ul>
  <li><a class="icon" href="http://www.facebook.com/sharer.php?u=http://yoursite.com/2018/06/17/%E4%BD%BF%E7%94%A8FluentAPI(EntityFramework)/" target="_blank" rel="noopener"><i class="fab fa-facebook fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://twitter.com/share?url=http://yoursite.com/2018/06/17/%E4%BD%BF%E7%94%A8FluentAPI(EntityFramework)/&text=使用FluentAPI(EntityFramework)" target="_blank" rel="noopener"><i class="fab fa-twitter fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.linkedin.com/shareArticle?url=http://yoursite.com/2018/06/17/%E4%BD%BF%E7%94%A8FluentAPI(EntityFramework)/&title=使用FluentAPI(EntityFramework)" target="_blank" rel="noopener"><i class="fab fa-linkedin fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://pinterest.com/pin/create/bookmarklet/?url=http://yoursite.com/2018/06/17/%E4%BD%BF%E7%94%A8FluentAPI(EntityFramework)/&is_video=false&description=使用FluentAPI(EntityFramework)" target="_blank" rel="noopener"><i class="fab fa-pinterest fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="mailto:?subject=使用FluentAPI(EntityFramework)&body=Check out this article: http://yoursite.com/2018/06/17/%E4%BD%BF%E7%94%A8FluentAPI(EntityFramework)/"><i class="fas fa-envelope fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://getpocket.com/save?url=http://yoursite.com/2018/06/17/%E4%BD%BF%E7%94%A8FluentAPI(EntityFramework)/&title=使用FluentAPI(EntityFramework)" target="_blank" rel="noopener"><i class="fab fa-get-pocket fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://reddit.com/submit?url=http://yoursite.com/2018/06/17/%E4%BD%BF%E7%94%A8FluentAPI(EntityFramework)/&title=使用FluentAPI(EntityFramework)" target="_blank" rel="noopener"><i class="fab fa-reddit fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.stumbleupon.com/submit?url=http://yoursite.com/2018/06/17/%E4%BD%BF%E7%94%A8FluentAPI(EntityFramework)/&title=使用FluentAPI(EntityFramework)" target="_blank" rel="noopener"><i class="fab fa-stumbleupon fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://digg.com/submit?url=http://yoursite.com/2018/06/17/%E4%BD%BF%E7%94%A8FluentAPI(EntityFramework)/&title=使用FluentAPI(EntityFramework)" target="_blank" rel="noopener"><i class="fab fa-digg fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.tumblr.com/share/link?url=http://yoursite.com/2018/06/17/%E4%BD%BF%E7%94%A8FluentAPI(EntityFramework)/&name=使用FluentAPI(EntityFramework)&description=" target="_blank" rel="noopener"><i class="fab fa-tumblr fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://news.ycombinator.com/submitlink?u=http://yoursite.com/2018/06/17/%E4%BD%BF%E7%94%A8FluentAPI(EntityFramework)/&t=使用FluentAPI(EntityFramework)" target="_blank" rel="noopener"><i class="fab fa-hacker-news fa-lg" aria-hidden="true"></i></a></li>
</ul>

    </div>

    <div id="actions-footer">
        <a id="menu" class="icon" href="#" onclick="$('#nav-footer').toggle();return false;"><i class="fas fa-bars fa-lg" aria-hidden="true"></i> Menu</a>
        <a id="toc" class="icon" href="#" onclick="$('#toc-footer').toggle();return false;"><i class="fas fa-list fa-lg" aria-hidden="true"></i> TOC</a>
        <a id="share" class="icon" href="#" onclick="$('#share-footer').toggle();return false;"><i class="fas fa-share-alt fa-lg" aria-hidden="true"></i> Share</a>
        <a id="top" style="display:none" class="icon" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');"><i class="fas fa-chevron-up fa-lg" aria-hidden="true"></i> Top</a>
    </div>

  </div>
</div>

        
        <footer id="footer">
  <div class="footer-left">
    Copyright &copy; 2020 Tmoonlight
  </div>
  <div class="footer-right">
    <nav>
      <ul>
         
          <li><a href="/">Home</a></li>
         
          <li><a href="/about/">About</a></li>
         
          <li><a href="/archives/">Writing</a></li>
         
          <li><a href="/projects_url">Projects</a></li>
        
      </ul>
    </nav>
  </div>
</footer>

    </div>
    <!-- styles -->

<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">


<link rel="stylesheet" href="/lib/justified-gallery/css/justifiedGallery.min.css">


    <!-- jquery -->

<script src="/lib/jquery/jquery.min.js"></script>


<script src="/lib/justified-gallery/js/jquery.justifiedGallery.min.js"></script>

<!-- clipboard -->

  
<script src="/lib/clipboard/clipboard.min.js"></script>

  <script type="text/javascript">
  $(function() {
    // copy-btn HTML
    var btn = "<span class=\"btn-copy tooltipped tooltipped-sw\" aria-label=\"Copy to clipboard!\">";
    btn += '<i class="far fa-clone"></i>';
    btn += '</span>'; 
    // mount it!
    $(".highlight table").before(btn);
    var clip = new ClipboardJS('.btn-copy', {
      text: function(trigger) {
        return Array.from(trigger.nextElementSibling.querySelectorAll('.code')).reduce((str,it)=>str+it.innerText+'\n','')
      }
    });
    clip.on('success', function(e) {
      e.trigger.setAttribute('aria-label', "Copied!");
      e.clearSelection();
    })
  })
  </script>


<script src="/js/main.js"></script>

<!-- search -->

<!-- Google Analytics -->

<!-- Baidu Analytics -->

<!-- Disqus Comments -->


</body>
</html>
